package object1;

public class Student {
    private String name = "xige";    //姓名
    private String gender;  //性别
    private int age;        //年龄
    private double score;   //分数
    private static String classRoom = "Bit_116"; //班级， 就地初始化

    public Student(){
        System.out.println(name);
        System.out.println("构造代码块");
    }

    public Student(String name, String gender, int age, double score) {
        this.name = name;
        this.gender = gender;
        this.age = age;
        this.score = score;
    }

    public void doClass(){
        System.out.println("按时上课，不要迟到，如果请假，及时去补");
    }
    //实例代码块
    {
        System.out.println(name);
        name = "喜哥";
        gender = "男";
        age = 19;
        score = 88;
        System.out.println("实例代码块");
        System.out.println(name);
    }

    //静态代码块
    static{
        System.out.println(classRoom);
        classRoom = "bit_116";
        System.out.println("静态代码块");
        System.out.println(classRoom);
    }

    public void doHomework(){
        System.out.println("教务系统，完成作业，一旦拖沓，神仙难救");
    }
    public void Exam(){
        System.out.println("考试目的，了解学情，人人必考，暴露问题");
    }

    @Override
    public String toString() {
        return "Student{" +
                "name='" + name + '\'' +
                ", gender='" + gender + '\'' +
                ", age=" + age +
                ", score=" + score +
                ", classRoom='" + classRoom + "\'" +
                '}';
    }

    public static void main(String[] args) {
        Student student0 = new Student();
        //Student student1 = new Student();
        System.out.println(student0);
    }
}
